package com.loong.web.gp4j.bean.param.users;

import java.util.LinkedHashSet;

import javax.validation.constraints.Null;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;

/**
 * 用户参数
 *
 * @author 张成轩
 */
public class UserParam {

	private Integer id;
	private String user;
	private String email;
	private String name;
	private String birthday;
	private Integer sex;
	private LinkedHashSet<Integer> auths;

	/**
	 * @return id
	 */
	@Null
	public Integer getId() {

		return id;
	}

	/**
	 * @param id id
	 */
	public void setId(Integer id) {

		this.id = id;
	}

	/**
	 * @return 用户
	 */
	@Pattern(regexp = "[a-zA-Z]\\w{2,14}", message = "用户必须以英文字母开头，3至15个字符之间。可以包含英文字母、数字、下划线。")
	public String getUser() {

		return user;
	}

	/**
	 * @param user 用户
	 */
	public void setUser(String user) {

		this.user = user;
	}

	/**
	 * @return 邮箱
	 */
	@NotBlank(message = "邮箱不能为空")
	@Email(message = "邮箱格式错误")
	public String getEmail() {

		return email;
	}

	/**
	 * @param email 邮箱
	 */
	public void setEmail(String email) {

		this.email = email;
	}

	/**
	 * @return 姓名
	 */
	public String getName() {

		return name;
	}

	/**
	 * @param name 姓名
	 */
	public void setName(String name) {

		this.name = name;
	}

	/**
	 * @return 生日
	 */
	@Pattern(regexp = "([0-9]{4}-[0-9]{2}-[0-9]{2})?", message = "日期格式错误")
	public String getBirthday() {

		return birthday;
	}

	/**
	 * @param birthday 生日
	 */
	public void setBirthday(String birthday) {

		this.birthday = birthday;
	}

	/**
	 * @return 性别
	 */
	public Integer getSex() {

		return sex;
	}

	/**
	 * @param sex 性别
	 */
	public void setSex(Integer sex) {

		this.sex = sex;
	}

	/**
	 * @return 权限
	 */
	public LinkedHashSet<Integer> getAuths() {

		return auths;
	}

	/**
	 * @param auths 权限
	 */
	public void setAuths(LinkedHashSet<Integer> auths) {

		this.auths = auths;
	}
}
